adapter: report error to clients when table writer terminates#37001
Draft
DAlperin wants to merge 1 commit into
Draft
adapter: report error to clients when table writer terminates#37001DAlperin wants to merge 1 commit into
DAlperin wants to merge 1 commit into
Conversation
In `group_commit_apply`, when the persist table writer's oneshot channel returns `Err` (sender dropped before sending a result), the writes are in an indefinite state. Previously we only logged a warning and then fell through to notify clients of success, telling them their writes were durably persisted when they may not have been. Now we propagate an error to the affected clients in this case instead of reporting success. Generated with [Linear](https://linear.app/materializeinc/issue/PER-14/persist-group-commit-reports-success-to-clients-when-persist-table#agent-session-eb632c19) Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In
group_commit_apply, when the persist table writer's oneshot channel returnsErr(the sender was dropped before sending a result), the writes are in an indefinite state. Previously we only logged a warning and then fell through to advance the oracle and notify clients of success viactx.retire(result)— telling clients their writes were durably persisted when they may not have been.Description
On the
Errbranch we now record that the write is in an indefinite state and, when retiring each affected client, replace the success result with anAdapterError::Internalrather than reporting success. The rest of the flow (oracle advance, timeline advancement, internal notifies) is unchanged, matching the prior best-effort behavior on this shutdown-adjacent path.Verification
No automated test added — this is a narrow error-reporting fix on a hard-to-reproduce failure path (writer task aborted mid-append). Verified by review; the change is local to the notification logic in
appends.rs.